package com.yex.controller.modify.user;

import com.yex.common.utils.R;
import com.yex.entity.UserTransferLogEntity;
import com.yex.service.modify.order.UserPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@RestController
@RequestMapping("/appApi/user")
public class UserController {

    @Autowired
    private UserPriceService userPriceService;

    @PostMapping("balance2Coin")
    public R balance2Coin(BigDecimal balance) {
        userPriceService.balance2Coin(balance);
        return R.ok();
    }


    @GetMapping("transferLogByPage")
    public R transferLogByPage(@RequestParam(name = "page", defaultValue = "1") Integer page, @RequestParam(name = "rows", defaultValue = "10") Integer rows) {
        List<UserTransferLogEntity> entityList = userPriceService.transferLogByPage(page, rows);
        return R.okData(entityList);
    }


}
